﻿using System;

namespace NativeCode.Core.Extensions
{
	public static class TypeExtensions
	{
		public static bool IsNumeric(this Type type)
		{
			TypeCode typeCode = Type.GetTypeCode(type);
			return typeCode.IsNumeric();
		}

		public static bool IsString(this Type type)
		{
			TypeCode typeCode = Type.GetTypeCode(type);
			return typeCode == TypeCode.String;
		}

		public static bool IsInequality(this Type type)
		{
			TypeCode typeCode = Type.GetTypeCode(type);
			return typeCode.CanCompareInequality();
		}
	}
}